Skip to content

feat: add many_from_buffer_exact for strict buffer size validation#21880

Merged
ludamad merged 2 commits intomerge-train/barretenbergfrom
claudebox/many-from-buffer-exact
Mar 22, 2026
Merged

feat: add many_from_buffer_exact for strict buffer size validation#21880
ludamad merged 2 commits intomerge-train/barretenbergfrom
claudebox/many-from-buffer-exact

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

Summary

  • Adds many_from_buffer_exact<T> helper in file_io.hpp that validates buffer sizes are exact multiples of sizeof(T) before deserializing, producing clear error messages for misaligned buffers.
  • Uses many_from_buffer_exact for UltraHonk proof and public inputs binary deserialization in api_ultra_honk.cpp.
  • Adds unit tests verifying rejection of trailing bytes and acceptance of aligned buffers.

ClaudeBox log: https://claudebox.work/s/339cddebbe6e2d8c?run=1

Adds many_from_buffer_exact<T> which validates that binary buffer sizes
are exact multiples of sizeof(T) before deserializing, giving clear
error messages when files have trailing bytes. Applied to UltraHonk
proof and public inputs deserialization.
@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels Mar 21, 2026
@ludamad ludamad marked this pull request as ready for review March 22, 2026 14:42
@ludamad ludamad enabled auto-merge (squash) March 22, 2026 14:42
@ludamad ludamad merged commit 2738227 into merge-train/barretenberg Mar 22, 2026
11 checks passed
@ludamad ludamad deleted the claudebox/many-from-buffer-exact branch March 22, 2026 14:54
github-merge-queue bot pushed a commit that referenced this pull request Mar 24, 2026
BEGIN_COMMIT_OVERRIDE
feat: add many_from_buffer_exact for strict buffer size validation
(#21880)
chore!: Make `is_less_than` range-check stricter (#21723)
fix: re-sign macOS binaries after stripping in copy_cross.sh (#21893)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants